package com.tyros.resource.tool;

import cn.hutool.core.io.file.FileNameUtil;

import java.io.File;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

/**
 * @author zhangshuaiyin
 * @date 2022/2/20 14:26
 */
public class FileNameTools extends FileNameUtil {

    public static final String PATH_PATTERN = "yyyy" + File.separator + "MM" + File.separator + "dd";

    /**
     * 默认保存目录，按照日期归档
     * yyyy\\MM\\dd\\
     *
     * @return 文件保存目录
     */
    public static String defaultPath() {
        return LocalDate.now().format(DateTimeFormatter.ofPattern(PATH_PATTERN)) + File.separator;
    }
}
